#ifndef QBUTTONMANAGER_H
#define QBUTTONMANAGER_H


#include <QObject>
#include "qerrorbutton.h"
#include <QVBoxLayout>
#include <QListWidget>
#include "qlistline.h"

class QButtonManager : public QObject
{
	Q_OBJECT
public:
	QButtonManager(QListWidget* error,QVBoxLayout* layout,QObject* parent=0);
	~QButtonManager();

	void refresh(const QList<QListLine*>& errors);
	QList<quint32> actualLines() const;
	QString currrentId() const;
public slots:
	void buttonChanged(const QString& id);
	
signals:
	void partChanged();
	
private:

	QString iconFromID(const QString& id);
	QString textFromID(const QString& id);
	void clearLayout();
	QHash<QString,QString> m_icon;
	QHash<QString,QString> m_text;
	QHash<QString,QList<QListLine*> > m_errors;
	QHash<QString,QErrorButton*> m_buttons;
	QVBoxLayout* m_layout;
	QListWidget* m_errorDisplay;
};

#endif 